/*
 * @Descripttion: 
 * @version: 
 * @Author: TT
 * @Date: 2023-06-01 22:39:27
 * @LastEditors: TT
 * @LastEditTime: 2023-06-02 09:20:45
 */

import 'package:example/pages/demo_module/tools/down_load_m3u8_tool.dart';
import 'package:flutter/material.dart';
import 'package:hzy_common_module/hzy_common_module.dart';

class DemoDownMV extends CommonGetXWidget<DemoDownMC> {
  DemoDownMV({Key? key}) : super(key: key);
  @override
  DemoDownMC get controller => Get.put(DemoDownMC());

  @override
  Widget createBody({BoxConstraints? constraints}) {
    Widget body = HzyBtnWidget(
      text: "开始下载",
      tapCall: () {
        controller.tapDown();
      },
    );

    return body;
  }
}

class DemoDownMC extends CommonGetXController {
  // --------- 属性 --------- //

  // --------- 生命周期  --------- //

  // --------- 数据处理  --------- //

  // --------- 触发事件  --------- //

  tapDown() {
    DownloadM3U8Util.instance.downloadM3u8(
        "https://hd.lz-cdn18.com/20230206/378_cc1111ab/index.m3u8");
  }
}
